import java.util.HashMap;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: tao
 * Date: 2023-11-05
 * Time: 20:03
 */
public class Test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] p = new int[n+1];
        for(int i = 1; i <= n; i++) {
            p[i] = sc.nextInt();
        }
        int count = n;
        while(count > 1) {
            //先找-1，这个没有指向，再找最大数，这个就是第二指向，把这些置为零，依次类推
            //找最大数
            int max = 0;
            for(int i = 1; i <= n; i++) {
                if(p[i] == -1) {
                    System.out.print(i + " ");
                    p[i] = 0;
                }

                if(max < p[i]) {
                    max = p[i];
                }
            }
            //找最大数的下标
            for(int i = 1; i <= n; i++) {
                if(max == p[i]) {
                    System.out.print(i + " ");
                    p[i] = 0;
                }
            }
            count--;
        }

    }
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        //定义一个map，把指向都放进去，key为指向，val为下标
        HashMap map = new HashMap<>();
        for(int i = 1; i <= n; i++) {
            int p = sc.nextInt();
            map.put(p, i);
        }
        //遍历一遍map
        for(int i = 1; i <= n; i++) {
            int x = (int) map.get(i);
            if(x == -1) {
                System.out.println(i);
            } else {
                System.out.println(x);
            }
        }
    }
}
